package com.weasel.weixin.commons.message.builder.initiative;

import com.weasel.weixin.commons.message.bean.initiative.MusicCustomInitiativeMessage;

/**
 * Created by Dylan on 2015/10/19.
 */
public class MusicCustomInitiativeMessageBuilder extends AbstractCustomInitiativeMessageBuilder<MusicCustomInitiativeMessageBuilder,MusicCustomInitiativeMessage> {


    public MusicCustomInitiativeMessageBuilder() {
        super(new MusicCustomInitiativeMessage());
    }

    public MusicCustomInitiativeMessageBuilder title(String title){

        getMusic().setTile(title);
        return this;
    }

    public MusicCustomInitiativeMessageBuilder description(String description){

        getMusic().setDescription(description);
        return this;
    }

    public MusicCustomInitiativeMessageBuilder musicUrl(String musicUrl){

        getMusic().setMusicUrl(musicUrl);
        return this;
    }

    public MusicCustomInitiativeMessageBuilder hqMusicUrl(String hqMusicUrl){

        getMusic().setHqMusicUrl(hqMusicUrl);
        return this;
    }

    public MusicCustomInitiativeMessageBuilder thumbMediaId(String thumbMediaId){

        getMusic().setThumbMediaId(thumbMediaId);
        return this;
    }


    private MusicCustomInitiativeMessage.Music getMusic(){

        MusicCustomInitiativeMessage.Music music = ((MusicCustomInitiativeMessage)message).getMusic();
        if(null == music){
            music = new MusicCustomInitiativeMessage.Music();
            ((MusicCustomInitiativeMessage) message).setMusic(music);
        }
        return music;
    }


}
